package com.itheima03;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class ReflectDemo2 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        // 获取 class 对象
        Class<?> c = Class.forName("com.itheima02.Student");

        Constructor<?> constructor = c.getConstructor(String.class, int.class, String.class);

        Object o = constructor.newInstance("另请下",30, "香港");
        System.out.println(o);
    }
}
